import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home/home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: home
  },
  { path: '/', name: '', redirect: '/home' },
  {
    path: '/articleinfo/:_id',
    name: 'articleinfo',
    component: () => import('../views/Article/ArticleInfo.vue')
  },
  {
    path: '/me',
    name: 'me',
    component: () => import('../views/me/me.vue')
  }
]
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
  routes
})


export default router
